import React, { Component } from 'react';
import { Switch, Route, NavLink, Redirect } from 'react-router-dom';

import News from './News';
import Message from './Message';

export default class Home extends Component {
  render() {
    return (
      <div>
        <h3>I am Component Home</h3>
        <ul className="nav nav-tabs">
          <li className="nav-item">
            <NavLink className="nav-link" to="/home/news">News</NavLink>
          </li>
          <li className="nav-item">
            <NavLink className="nav-link" to="/home/message">Message</NavLink>
          </li>
        </ul>
        <Switch>
          <Route path="/home/news" component={News} />
          <Route path="/home/message" component={Message} />
          <Redirect to="/home/news" />
        </Switch>
      </div>

    )
  }
}
